#include <iostream>
#include <algorithm>
#include <string>
#include <cstdio>
#include <vector>
#include <stack>
#include <queue>
#include <set>
using namespace std;
class Solution
{
public:
    vector<int> getRow(int rowIndex)
    {
        queue<int> Que0, Que1;
        Que0.push(1);
        for (int i = 0; i < rowIndex; ++i)
        {
            int u = 0, v;
            while (Que0.empty() == false)
            {
                v = Que0.front(), Que0.pop();
                u += v;
                Que1.push(u);
                u = v;
            }
            Que1.push(1);
            Que0 = Que1;
            Que1 = queue<int>();
        }
        vector<int> ans;
        while (Que0.empty() == false)
            ans.push_back(Que0.front()), Que0.pop();
        return ans;
    }
};